import cv2
cap=cv2.VideoCapture(0)
while True:
    sucess,frame=cap.read()
    frame=cv2.flip(frame,1)
    cv2.imshow('Video',frame)
    k=cv2.waitKey(1)
    if k == 27:
        cv2.destroyAllWindows()
        break
    elif k==ord("s"):

        cv2.imwrite("image2.jpg",frame)

        cv2.destroyAllWindows()

        break
cap.release()
